﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.sim {
    import Engine.Classes.*;
    import Classes.actions.*;

    public class NPCActionQueue extends StateMachine {

        public function addActions(... _args):void{
            var _local2:*;
            var _local3:BaseAction;
            for each (_local2 in _args) {
                _local3 = (_local2 as BaseAction);
                if (_local3 != null){
                    this.addState(_local3, true);
                } else {
                    throw (new Error((("Failed to add action " + _local2) + ", expected BaseAction")));
                };
            };
        }
        public function addActionsArray(_arg1:Array):void{
            var _local2:*;
            var _local3:BaseAction;
            for each (_local2 in _arg1) {
                _local3 = (_local2 as BaseAction);
                if (_local3 != null){
                    this.addState(_local3, true);
                } else {
                    throw (new Error((("Failed to add action " + _local2) + ", expected BaseAction")));
                };
            };
        }
        public function insertActionsArray(_arg1:int, _arg2:Array):void{
            var _local4:*;
            var _local5:BaseAction;
            var _local3:int = _arg1;
            for each (_local4 in _arg2) {
                _local5 = (_local4 as BaseAction);
                if (_local5 != null){
                    m_states.splice(_local3, 0, _local5);
                    m_states[_local3].added();
                } else {
                    throw (new Error((("Failed to add action " + _local4) + ", expected BaseAction")));
                };
            };
        }

    }
}//package Classes.sim 
